<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .sliderbar{
            position:absolute;
            width: 40px;
            height: 40px;
            background-color:pink;
            right: 0px;
            top: 700px;
        }
        .con{
            position: absolute;
            /* 动画一定要加绝对定位才能移动 */
            width: 150px;
            height: 40px;
            z-index: -1;
            background-color: pink;
            left: 0px;
            top: 0px;
            /* 
            子div放在父div里面所以只要设置父亲的宽高
            */
            
        }
    </style>
     <script src="animate.js"></script>
</head>

<body>
    <div class="sliderbar">
        <span>🔙</span>
        <div class="con">问题反馈</div>
    </div>
</body>
<script>
    var sliderbar1 = document.querySelector('.sliderbar');
    var con1 = document.querySelector('.con');
    sliderbar1.addEventListener('mouseenter',function(){
        animate(con1,-110,function(){
            sliderbar1.children[0].innerHTML = '🔜';
            // 回调函数，当动画停止时才调用
        });
    })
    sliderbar1.addEventListener('mouseleave',function(){
        animate(con1,0,function(){
            sliderbar1.children[0].innerHTML = '🔙';
        });
    })
</script>
</body>
</html>